{% extends '../../../layout/admin-base.html' %}
<script src="{{ assets_path("js/base.js")}}"></script>
{% block page %}
<h3 class="page-title">
    保洁员／宿管员信息 <small>新增</small>
</h3>
<ul class="breadcrumb">
    <li>
        <i class="icon-home"></i>
        <a href="index.html">基本信息管理</a> 
        <i class="icon-angle-right"></i>
    </li>
    <li>
        <a href="{{url('admin/user/student')}}">保洁员／宿管员信息管理</a>
        <i class="icon-angle-right"></i>
    </li>
    <li><span>新增</span></li>
</ul>
{% end%}
{% block content %}

<div class="row-fluid">
    <div class="span12">
        <div class="portlet box blue">
            <div class="portlet-title">
                <div class="caption"><i class="icon-plus"></i>新增保洁员／宿管员</div>
                <div class="tools">
                    <a href="javascript:;" class="collapse"></a>
                </div>
            </div>
            <div class="portlet-body form">
                <!-- BEGIN FORM-->
                <form id="form" action="" class="form-horizontal" method="post" enctype ="multipart/form-data">
                    <div class="control-group">
                        <label class="control-label">保洁员／宿管员姓名<span class="required">*</span></label>
                        <div class="controls">
                            <input type="text" class="span6 m-wrap" name="Fname" value="{{ staff.get('Fname', '') }}" />
                            <span class="help-inline">Some hint here</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">手机号<span class="required">*</span></label>
                        <div class="controls">
                            <input type="text" class="span6 m-wrap" name="Ftel" value="{{ staff.get('Ftel', '') }}" />
                            <span class="help-inline">Some hint here</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">照片<span class="required">*</span></label>
                        <div class="controls">
                            <input type="file" class="span6 m-wrap" name="Favater" value="{{ staff.get('Favater', '') }}" />
                            <span class="help-inline">Some hint here</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">宿舍楼号<span class="required">*</span></label>
                        <div class="controls">
                            <select class="span6 m-wrap" name="Fdorm_id" id="Fdorm_id">
                                {% for i in drom %}
                                    <option value="{{ i['Fid'] }}" {% if i["Fid"]==staff.get("Fdorm_id") %}selected='selected'{% end %}>{{ i['Fdorm_name'] }}</option>
                                {% end %}
                            </select>
                            <span class="help-inline">Some hint here</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">入职时间<span class="required">*</span></label>
                        <div class="controls">
                            <input type="text" class="span6 m-wrap" name="Fhire_date" value="{{ staff.get('Fhire_date', '') }}" />
                            <span class="help-inline">Some hint here</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">年龄<span class="required">*</span></label>
                        <div class="controls">
                            <input type="text" class="span6 m-wrap" name="Fage" value="{{ staff.get('Fage', '') }}" />
                            <span class="help-inline">Some hint here</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">职能类型</label>
                        <div class="controls">
                            <select class="span6 m-wrap" name="Fposition" data-placeholder="Choose a Category" tabindex="1">
                                <option value="1" {% if '1'==staff.get("Fposition") %}selected='selected'{% end %}>保洁员</option>
                                <option value="2" {% if '2'==staff.get("Fposition") %}selected='selected'{% end %}>宿管员</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-actions">
                        <button type="submit" class="btn blue">保存</button>
                        <!-- <button type="button" id="sub" class="btn">保存并新增下一条</button> -->
                    </div>
                </form>
                <!-- END FORM--> 
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
window.onload = function() {

    $("#sub").click(function(){
        $('#form').attr('action', '?ltype=1')
        $('#form').submit()
        $('#form').attr('action', '')
    })

}
</script>
{% end%}